{% assign enable_nav = false %}
{% if site.data.nav[page.nav] %}
  {% assign enable_nav = true %}
{% endif %}

{% if enable_nav %}
{% for item in site.data.nav[page.nav] %}
<section class="nav-wrapper" class="ps-0 pe-4">
  <h2 class="panel-heading ps-3 pt-2 mb-2">{{ item.title }}</h2>
  <nav id="pages">
    <ul>
      {% for item in item.children %}
        <li><a href="{{ site.baseurl }}{{ item.url }}" {% if item.url == page.url %}class="active"{% endif %}>{{ item.title }}</a></li>
      {% endfor %}
    </ul>
  </nav>
</section>
{% endfor %}
{% endif %}
